package app.web.cartoon.report.num.tool;

import app.web.spe.ResSPE;
import cn.lily.com.db.DBFactory;
import cn.lily.com.enviroment.Enviroment;
/**
 * 动漫数据量分析
 * @author JiaJ
 *
 */
public class CartoonNumReport extends BaseNumReport {

	@Override
	protected void afterData() {
		
		DBFactory.getActionDB().executeUpdate("delete from LEO_CAN_REPORT_NUM");
		
		for(String date:this.dateResult){
			
			String sql = "insert into LEO_CAN_REPORT_NUM (RES_TIME,LEO_CAN_DATE_INF,LEO_CAN_NUM_TOTAL,LEO_CAN_NUM_ADD) "
					          + "values (to_date('"+date+"','yyyy-mm-dd'),"
					          		  + "'"+date+"',"
					          		  + ""+this.dataAllMap.get(date)+","+this.dataPlusMap.get(date)+")";
			
			DBFactory.getActionDB().executeUpdate(sql);
			
		}
		
		DBFactory.getActionDB().commit();
		
	}

	@Override
	protected void beforeData() {
		
		this.setDataTyp(ResSPE.DATA_TYP_CARTOON);
		
	}

	public static void main(String[] args) {
		
		Enviroment.createEnv();
		Enviroment.getEnv().getLogBean().beginLog();
		
		CartoonNumReport numReport = new CartoonNumReport();		
		numReport.inst();
		
		
		
	}
	
}
